﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebApplication1.BLL;
using WebApplication1.Models;

namespace WebApplication1.Controllers
{
    public class AboutAPPController : Controller
    {
        AppAboutBLL appbll = new AppAboutBLL();

        //获取关于我们
        public string GetAboutUs()
        {
            string jsonTxt = "";
            try
            {
                string aboutus = appbll.GetAboutUs();
                jsonTxt = aboutus;
            }
            catch (Exception ex)
            {
                jsonTxt = "\"error500\"";
                string saveFolder = "Log\\Controller";
                string msg = "AboutAPP/GetAboutUs，" + ex.Message;
                Common.LogManager.AddLog(msg, saveFolder);
            }
            String callbackFunName = Request["jsoncallback"];
            string back = callbackFunName + "(\"" + jsonTxt + "\")";
            return back;
        }

        /// <summary>
        /// 查询签到、视频截止日期
        /// </summary>
        /// <returns></returns>
        public string GetQianDaoVideoEndDate()
        {
            string backTxt = "";
            try
            {
                string classId = Request["classId"];
                string qvEndDate = "";//截止日期
                object dateJsonObj = appbll.GetQvEndDate(classId,out qvEndDate);
                backTxt = Newtonsoft.Json.JsonConvert.SerializeObject(dateJsonObj);
            }
            catch (Exception ex)
            {
                backTxt = "\"error500\"";
            }
            String callbackFunName = Request["jsoncallback"];
            string back = callbackFunName + "(" + backTxt + ")";
            return back;
        }

    }
}